'use strict';

angular.module('crawlerApp')

.filter('taskConfigFormat', [function() {
  return function(config) {
    var res = {
      previous: config.previous,
      projects: []
    };
    for (var i = 0; i < config.group.length; i++) {
      var group = config.group[i];
      for (var j = 0; j < group.projects.length; j++) {
        res.projects.push(group.projects[j]);
      }
    }
    return res;
  };
}]);
